#!/bin/bash

port=8282								# 后端端口
JASYPT_PASSWORD=XXXXXXXXXXXXX

docker rm -f acm_rating
docker rmi -f acm_rating:0.1
docker build -t acm_rating:0.1  .


WORKDIR=$(pwd)
current_jar_name=$WORKDIR/acm-rating-0.1.2-SNAPSHOT.jar


#docker run  -dit   -v  $current_jar_name:/home/acm-rating.jar -v  $WORKDIR/image:/home/image \
#     --name="acm_rating" acm_rating:0.1

docker run  -d  --restart=always -p $port:8080 -v  $current_jar_name:/home/acm-rating.jar -v $WORKDIR/image:/home/image \
  --env JASYPT_PASSWORD=$JASYPT_PASSWORD  --name="acm_rating" acm_rating:0.1

